//
//  NSMMotionManager.h
//  Helper
//
//  Created by nsm on 2019/5/13.
//  Copyright © 2019 nani. All rights reserved.
//

#import <Foundation/Foundation.h>

#define _motionManager  ([NSMMotionManager sharedInstance])

NS_ASSUME_NONNULL_BEGIN

@interface NSMMotionManager : NSObject

/** 间隔(s) 默认0.03(1/30) 保证刷新频率>30帧,否则看起来很迟钝 */
@property (nonatomic) NSTimeInterval timeInterval;

+ (instancetype)sharedInstance;

/** 重力感应 */
- (void)startGyroUpdates:(void(^)(double x, double y, double z))hander;
/** 陀螺仪 */
- (void)startDeviceMotionUpdates:(void(^)(double x, double y, double z))hander;
/** 加速计 */
- (void)startAccelerometerUpdates:(void(^)(double x, double y, double z))hander;

- (void)stopAllUpdates;

@end

NS_ASSUME_NONNULL_END
